import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;

/**
 * @author zhu
 * @date 2024-04-10
 */
public class MainTest {
    public static void main(String[] args) {
        List<Student> students = new ArrayList<>();
        students.add(new Student("大傻椿", 20));
        students.add(new Student("黑佬", 22));
        students.add(new Student("大佐", 18));

        Supplier<Student> getYounger = () -> {
            return students.stream().min((s1, s2) -> s1.getAge() - s2.getAge()).orElse(null);
        };

        Student younger = getYounger.get();
        System.out.println(younger.toString());
    }
}
